home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
cpp_libs
/
intrvews
/
xgrab.lha
/
xgrab
/
include
/
scrdep.h
< prev
next >
Wrap
C/C++ Source or Header
|
1990-03-06
|
991b
|
31 lines
/**
GRAB Graph Layout and Browser System
Copyright (c) 1986, 1988 Regents of the University of California
Copyright (c) 1989, Tera Computer Company
**/
/* macros to convert absolute coordinates to screen coordinates and back */
#ifndef scrdep_h
#define scrdep_h
#include "screen.h"
#define ABSX_TO_SCRX(scr, ax) \
(((ax - (scr)->absview.min_x) / (scr)->zoom.xzoom) + (scr)->canvas.min_x - (scr)->display.min_x)
#define ABSY_TO_SCRY(scr, ay) \
(((ay - (scr)->absview.min_y) / (scr)->zoom.yzoom) + (scr)->canvas.min_y - (scr)->display.min_y)
#define SCRX_TO_ABSX(scr, sx) \
(((sx + (scr)->display.min_x - (scr)->canvas.min_x) * (scr)->zoom.xzoom) + (scr)->absview.min_x)
#define SCRY_TO_ABSY(scr, sy) \
(((sy + (scr)->display.min_y - (scr)->canvas.min_y) * (scr)->zoom.yzoom) + (scr)->absview.min_y)
#define SCALE_X(scr, ax) ((float) ax / (scr)->zoom.xzoom)
#define SCALE_Y(scr, ay) ((float) ay / (scr)->zoom.yzoom)
#endif